package com.atwisdom.star.dcs.Thread;

import com.atwisdom.star.dcs.service.Impl.RealTimeHourStatServiceImpl;
import com.atwisdom.star.dcs.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RealTimeInfoHourTread implements Runnable  {

    @Autowired
    private RealTimeHourStatServiceImpl realTimeHourStatService;

    @Override
    public void run() {
        while (true) {
            System.out.println("按小时统计开始啦");
            try {
                realTimeHourStatService.realTimeDataStat();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
            System.out.println("按小时统计暂停10分钟，休息一会儿");
            Utils.sleep(60000l * 10);
        }
    }
}
